LGF_NthRoot (FC / V3.0.1)


Author: Siemens Digital Industry

Short description

This function extracts the n-th root of a given value.

The root is defined as follows:

result = \sqrt[root]{value} = value^{\frac{1}{root}}

STEP 7 (TIA Portal) results in the following formula:

result = value ** (1 / root)

Block Interface

LGF_NthRoot (FC)
LReal  value Ret_Val  LReal
    
LReal  root error  Bool
    
   status  Word
    
   

Input parameter

IdentifierData typeDescription
valueLRealValue from which the root should be calculated.
rootLRealExponent
of root

Output parameter

IdentifierData typeDescription
Ret_ValLRealReturns the Nth root of a value
errorBoolFALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_NO_ERROR
Execution finished without errors
16#8200ERR_NEG_VAR
Error: Negative value for root exponend not permitted (Leads to complex numbers)

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
19.08.2015First released version
01.00.01Siemens Industry Online Support
02.01.2017Upgrade: TIA Portal V14 Update 1
01.00.02Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.03Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.04Simatic Systems Support
17.01.2019Calculation changed
01.00.09Simatic Systems Support
13.11.2019Renamed from "LGF_XRoot" to "LGF_NthRoot"
Regions, comments and constants are added
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
12.11.2020Insert documentation